package com.cloud.code.线程;

public class Demo {

    static boolean flag;

    public static void main(String[] args) throws InterruptedException {

        new Thread(()->{
            System.out.println("enter");
            while (!flag){
                System.out.println(flag);
            }System.out.println("end");
        }).start();
        Thread.sleep(1000);
        flag = true;

    }
}
